/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";

var $protobuf = require("protobufjs/minimal");

// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;

// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});

$root.Messages = (function() {

    /**
     * Namespace Messages.
     * @exports Messages
     * @namespace
     */
    var Messages = {};

    Messages.LoginRequest = (function() {

        /**
         * Properties of a LoginRequest.
         * @memberof Messages
         * @interface ILoginRequest
         * @property {string} userName LoginRequest userName
         * @property {string} psw LoginRequest psw
         */

        /**
         * Constructs a new LoginRequest.
         * @memberof Messages
         * @classdesc Represents a LoginRequest.
         * @implements ILoginRequest
         * @constructor
         * @param {Messages.ILoginRequest=} [properties] Properties to set
         */
        function LoginRequest(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LoginRequest userName.
         * @member {string} userName
         * @memberof Messages.LoginRequest
         * @instance
         */
        LoginRequest.prototype.userName = "";

        /**
         * LoginRequest psw.
         * @member {string} psw
         * @memberof Messages.LoginRequest
         * @instance
         */
        LoginRequest.prototype.psw = "";

        /**
         * Creates a new LoginRequest instance using the specified properties.
         * @function create
         * @memberof Messages.LoginRequest
         * @static
         * @param {Messages.ILoginRequest=} [properties] Properties to set
         * @returns {Messages.LoginRequest} LoginRequest instance
         */
        LoginRequest.create = function create(properties) {
            return new LoginRequest(properties);
        };

        /**
         * Encodes the specified LoginRequest message. Does not implicitly {@link Messages.LoginRequest.verify|verify} messages.
         * @function encode
         * @memberof Messages.LoginRequest
         * @static
         * @param {Messages.ILoginRequest} message LoginRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LoginRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            writer.uint32(/* id 1, wireType 2 =*/10).string(message.userName);
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.psw);
            return writer;
        };

        /**
         * Encodes the specified LoginRequest message, length delimited. Does not implicitly {@link Messages.LoginRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof Messages.LoginRequest
         * @static
         * @param {Messages.ILoginRequest} message LoginRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LoginRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LoginRequest message from the specified reader or buffer.
         * @function decode
         * @memberof Messages.LoginRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {Messages.LoginRequest} LoginRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LoginRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Messages.LoginRequest();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.userName = reader.string();
                    break;
                case 2:
                    message.psw = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            if (!message.hasOwnProperty("userName"))
                throw $util.ProtocolError("missing required 'userName'", { instance: message });
            if (!message.hasOwnProperty("psw"))
                throw $util.ProtocolError("missing required 'psw'", { instance: message });
            return message;
        };

        /**
         * Decodes a LoginRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof Messages.LoginRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {Messages.LoginRequest} LoginRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LoginRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LoginRequest message.
         * @function verify
         * @memberof Messages.LoginRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LoginRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (!$util.isString(message.userName))
                return "userName: string expected";
            if (!$util.isString(message.psw))
                return "psw: string expected";
            return null;
        };

        /**
         * Creates a LoginRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof Messages.LoginRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {Messages.LoginRequest} LoginRequest
         */
        LoginRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.Messages.LoginRequest)
                return object;
            var message = new $root.Messages.LoginRequest();
            if (object.userName != null)
                message.userName = String(object.userName);
            if (object.psw != null)
                message.psw = String(object.psw);
            return message;
        };

        /**
         * Creates a plain object from a LoginRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof Messages.LoginRequest
         * @static
         * @param {Messages.LoginRequest} message LoginRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LoginRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.userName = "";
                object.psw = "";
            }
            if (message.userName != null && message.hasOwnProperty("userName"))
                object.userName = message.userName;
            if (message.psw != null && message.hasOwnProperty("psw"))
                object.psw = message.psw;
            return object;
        };

        /**
         * Converts this LoginRequest to JSON.
         * @function toJSON
         * @memberof Messages.LoginRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LoginRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return LoginRequest;
    })();

    Messages.LoginRespone = (function() {

        /**
         * Properties of a LoginRespone.
         * @memberof Messages
         * @interface ILoginRespone
         * @property {number} code LoginRespone code
         * @property {number} uid LoginRespone uid
         */

        /**
         * Constructs a new LoginRespone.
         * @memberof Messages
         * @classdesc Represents a LoginRespone.
         * @implements ILoginRespone
         * @constructor
         * @param {Messages.ILoginRespone=} [properties] Properties to set
         */
        function LoginRespone(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * LoginRespone code.
         * @member {number} code
         * @memberof Messages.LoginRespone
         * @instance
         */
        LoginRespone.prototype.code = 0;

        /**
         * LoginRespone uid.
         * @member {number} uid
         * @memberof Messages.LoginRespone
         * @instance
         */
        LoginRespone.prototype.uid = 0;

        /**
         * Creates a new LoginRespone instance using the specified properties.
         * @function create
         * @memberof Messages.LoginRespone
         * @static
         * @param {Messages.ILoginRespone=} [properties] Properties to set
         * @returns {Messages.LoginRespone} LoginRespone instance
         */
        LoginRespone.create = function create(properties) {
            return new LoginRespone(properties);
        };

        /**
         * Encodes the specified LoginRespone message. Does not implicitly {@link Messages.LoginRespone.verify|verify} messages.
         * @function encode
         * @memberof Messages.LoginRespone
         * @static
         * @param {Messages.ILoginRespone} message LoginRespone message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LoginRespone.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.uid);
            return writer;
        };

        /**
         * Encodes the specified LoginRespone message, length delimited. Does not implicitly {@link Messages.LoginRespone.verify|verify} messages.
         * @function encodeDelimited
         * @memberof Messages.LoginRespone
         * @static
         * @param {Messages.ILoginRespone} message LoginRespone message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        LoginRespone.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a LoginRespone message from the specified reader or buffer.
         * @function decode
         * @memberof Messages.LoginRespone
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {Messages.LoginRespone} LoginRespone
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LoginRespone.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Messages.LoginRespone();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.code = reader.int32();
                    break;
                case 2:
                    message.uid = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            if (!message.hasOwnProperty("code"))
                throw $util.ProtocolError("missing required 'code'", { instance: message });
            if (!message.hasOwnProperty("uid"))
                throw $util.ProtocolError("missing required 'uid'", { instance: message });
            return message;
        };

        /**
         * Decodes a LoginRespone message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof Messages.LoginRespone
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {Messages.LoginRespone} LoginRespone
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        LoginRespone.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a LoginRespone message.
         * @function verify
         * @memberof Messages.LoginRespone
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        LoginRespone.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (!$util.isInteger(message.code))
                return "code: integer expected";
            if (!$util.isInteger(message.uid))
                return "uid: integer expected";
            return null;
        };

        /**
         * Creates a LoginRespone message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof Messages.LoginRespone
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {Messages.LoginRespone} LoginRespone
         */
        LoginRespone.fromObject = function fromObject(object) {
            if (object instanceof $root.Messages.LoginRespone)
                return object;
            var message = new $root.Messages.LoginRespone();
            if (object.code != null)
                message.code = object.code | 0;
            if (object.uid != null)
                message.uid = object.uid | 0;
            return message;
        };

        /**
         * Creates a plain object from a LoginRespone message. Also converts values to other types if specified.
         * @function toObject
         * @memberof Messages.LoginRespone
         * @static
         * @param {Messages.LoginRespone} message LoginRespone
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        LoginRespone.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.code = 0;
                object.uid = 0;
            }
            if (message.code != null && message.hasOwnProperty("code"))
                object.code = message.code;
            if (message.uid != null && message.hasOwnProperty("uid"))
                object.uid = message.uid;
            return object;
        };

        /**
         * Converts this LoginRespone to JSON.
         * @function toJSON
         * @memberof Messages.LoginRespone
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        LoginRespone.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return LoginRespone;
    })();

    Messages.CreateRoomRequest = (function() {

        /**
         * Properties of a CreateRoomRequest.
         * @memberof Messages
         * @interface ICreateRoomRequest
         * @property {number} uid CreateRoomRequest uid
         */

        /**
         * Constructs a new CreateRoomRequest.
         * @memberof Messages
         * @classdesc Represents a CreateRoomRequest.
         * @implements ICreateRoomRequest
         * @constructor
         * @param {Messages.ICreateRoomRequest=} [properties] Properties to set
         */
        function CreateRoomRequest(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CreateRoomRequest uid.
         * @member {number} uid
         * @memberof Messages.CreateRoomRequest
         * @instance
         */
        CreateRoomRequest.prototype.uid = 0;

        /**
         * Creates a new CreateRoomRequest instance using the specified properties.
         * @function create
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {Messages.ICreateRoomRequest=} [properties] Properties to set
         * @returns {Messages.CreateRoomRequest} CreateRoomRequest instance
         */
        CreateRoomRequest.create = function create(properties) {
            return new CreateRoomRequest(properties);
        };

        /**
         * Encodes the specified CreateRoomRequest message. Does not implicitly {@link Messages.CreateRoomRequest.verify|verify} messages.
         * @function encode
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {Messages.ICreateRoomRequest} message CreateRoomRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CreateRoomRequest.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.uid);
            return writer;
        };

        /**
         * Encodes the specified CreateRoomRequest message, length delimited. Does not implicitly {@link Messages.CreateRoomRequest.verify|verify} messages.
         * @function encodeDelimited
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {Messages.ICreateRoomRequest} message CreateRoomRequest message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CreateRoomRequest.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CreateRoomRequest message from the specified reader or buffer.
         * @function decode
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {Messages.CreateRoomRequest} CreateRoomRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CreateRoomRequest.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Messages.CreateRoomRequest();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.uid = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            if (!message.hasOwnProperty("uid"))
                throw $util.ProtocolError("missing required 'uid'", { instance: message });
            return message;
        };

        /**
         * Decodes a CreateRoomRequest message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {Messages.CreateRoomRequest} CreateRoomRequest
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CreateRoomRequest.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CreateRoomRequest message.
         * @function verify
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CreateRoomRequest.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (!$util.isInteger(message.uid))
                return "uid: integer expected";
            return null;
        };

        /**
         * Creates a CreateRoomRequest message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {Messages.CreateRoomRequest} CreateRoomRequest
         */
        CreateRoomRequest.fromObject = function fromObject(object) {
            if (object instanceof $root.Messages.CreateRoomRequest)
                return object;
            var message = new $root.Messages.CreateRoomRequest();
            if (object.uid != null)
                message.uid = object.uid | 0;
            return message;
        };

        /**
         * Creates a plain object from a CreateRoomRequest message. Also converts values to other types if specified.
         * @function toObject
         * @memberof Messages.CreateRoomRequest
         * @static
         * @param {Messages.CreateRoomRequest} message CreateRoomRequest
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CreateRoomRequest.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults)
                object.uid = 0;
            if (message.uid != null && message.hasOwnProperty("uid"))
                object.uid = message.uid;
            return object;
        };

        /**
         * Converts this CreateRoomRequest to JSON.
         * @function toJSON
         * @memberof Messages.CreateRoomRequest
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CreateRoomRequest.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return CreateRoomRequest;
    })();

    Messages.CreateRoomResponse = (function() {

        /**
         * Properties of a CreateRoomResponse.
         * @memberof Messages
         * @interface ICreateRoomResponse
         * @property {number} code CreateRoomResponse code
         * @property {number} roomId CreateRoomResponse roomId
         */

        /**
         * Constructs a new CreateRoomResponse.
         * @memberof Messages
         * @classdesc Represents a CreateRoomResponse.
         * @implements ICreateRoomResponse
         * @constructor
         * @param {Messages.ICreateRoomResponse=} [properties] Properties to set
         */
        function CreateRoomResponse(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * CreateRoomResponse code.
         * @member {number} code
         * @memberof Messages.CreateRoomResponse
         * @instance
         */
        CreateRoomResponse.prototype.code = 0;

        /**
         * CreateRoomResponse roomId.
         * @member {number} roomId
         * @memberof Messages.CreateRoomResponse
         * @instance
         */
        CreateRoomResponse.prototype.roomId = 0;

        /**
         * Creates a new CreateRoomResponse instance using the specified properties.
         * @function create
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {Messages.ICreateRoomResponse=} [properties] Properties to set
         * @returns {Messages.CreateRoomResponse} CreateRoomResponse instance
         */
        CreateRoomResponse.create = function create(properties) {
            return new CreateRoomResponse(properties);
        };

        /**
         * Encodes the specified CreateRoomResponse message. Does not implicitly {@link Messages.CreateRoomResponse.verify|verify} messages.
         * @function encode
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {Messages.ICreateRoomResponse} message CreateRoomResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CreateRoomResponse.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.roomId);
            return writer;
        };

        /**
         * Encodes the specified CreateRoomResponse message, length delimited. Does not implicitly {@link Messages.CreateRoomResponse.verify|verify} messages.
         * @function encodeDelimited
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {Messages.ICreateRoomResponse} message CreateRoomResponse message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        CreateRoomResponse.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a CreateRoomResponse message from the specified reader or buffer.
         * @function decode
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {Messages.CreateRoomResponse} CreateRoomResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CreateRoomResponse.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Messages.CreateRoomResponse();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.code = reader.int32();
                    break;
                case 2:
                    message.roomId = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            if (!message.hasOwnProperty("code"))
                throw $util.ProtocolError("missing required 'code'", { instance: message });
            if (!message.hasOwnProperty("roomId"))
                throw $util.ProtocolError("missing required 'roomId'", { instance: message });
            return message;
        };

        /**
         * Decodes a CreateRoomResponse message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {Messages.CreateRoomResponse} CreateRoomResponse
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        CreateRoomResponse.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a CreateRoomResponse message.
         * @function verify
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        CreateRoomResponse.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (!$util.isInteger(message.code))
                return "code: integer expected";
            if (!$util.isInteger(message.roomId))
                return "roomId: integer expected";
            return null;
        };

        /**
         * Creates a CreateRoomResponse message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {Messages.CreateRoomResponse} CreateRoomResponse
         */
        CreateRoomResponse.fromObject = function fromObject(object) {
            if (object instanceof $root.Messages.CreateRoomResponse)
                return object;
            var message = new $root.Messages.CreateRoomResponse();
            if (object.code != null)
                message.code = object.code | 0;
            if (object.roomId != null)
                message.roomId = object.roomId | 0;
            return message;
        };

        /**
         * Creates a plain object from a CreateRoomResponse message. Also converts values to other types if specified.
         * @function toObject
         * @memberof Messages.CreateRoomResponse
         * @static
         * @param {Messages.CreateRoomResponse} message CreateRoomResponse
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        CreateRoomResponse.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.code = 0;
                object.roomId = 0;
            }
            if (message.code != null && message.hasOwnProperty("code"))
                object.code = message.code;
            if (message.roomId != null && message.hasOwnProperty("roomId"))
                object.roomId = message.roomId;
            return object;
        };

        /**
         * Converts this CreateRoomResponse to JSON.
         * @function toJSON
         * @memberof Messages.CreateRoomResponse
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        CreateRoomResponse.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return CreateRoomResponse;
    })();

    Messages.SendChat = (function() {

        /**
         * Properties of a SendChat.
         * @memberof Messages
         * @interface ISendChat
         * @property {string} content SendChat content
         */

        /**
         * Constructs a new SendChat.
         * @memberof Messages
         * @classdesc Represents a SendChat.
         * @implements ISendChat
         * @constructor
         * @param {Messages.ISendChat=} [properties] Properties to set
         */
        function SendChat(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * SendChat content.
         * @member {string} content
         * @memberof Messages.SendChat
         * @instance
         */
        SendChat.prototype.content = "";

        /**
         * Creates a new SendChat instance using the specified properties.
         * @function create
         * @memberof Messages.SendChat
         * @static
         * @param {Messages.ISendChat=} [properties] Properties to set
         * @returns {Messages.SendChat} SendChat instance
         */
        SendChat.create = function create(properties) {
            return new SendChat(properties);
        };

        /**
         * Encodes the specified SendChat message. Does not implicitly {@link Messages.SendChat.verify|verify} messages.
         * @function encode
         * @memberof Messages.SendChat
         * @static
         * @param {Messages.ISendChat} message SendChat message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendChat.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            writer.uint32(/* id 1, wireType 2 =*/10).string(message.content);
            return writer;
        };

        /**
         * Encodes the specified SendChat message, length delimited. Does not implicitly {@link Messages.SendChat.verify|verify} messages.
         * @function encodeDelimited
         * @memberof Messages.SendChat
         * @static
         * @param {Messages.ISendChat} message SendChat message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        SendChat.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a SendChat message from the specified reader or buffer.
         * @function decode
         * @memberof Messages.SendChat
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {Messages.SendChat} SendChat
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendChat.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Messages.SendChat();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.content = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            if (!message.hasOwnProperty("content"))
                throw $util.ProtocolError("missing required 'content'", { instance: message });
            return message;
        };

        /**
         * Decodes a SendChat message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof Messages.SendChat
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {Messages.SendChat} SendChat
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        SendChat.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a SendChat message.
         * @function verify
         * @memberof Messages.SendChat
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        SendChat.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (!$util.isString(message.content))
                return "content: string expected";
            return null;
        };

        /**
         * Creates a SendChat message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof Messages.SendChat
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {Messages.SendChat} SendChat
         */
        SendChat.fromObject = function fromObject(object) {
            if (object instanceof $root.Messages.SendChat)
                return object;
            var message = new $root.Messages.SendChat();
            if (object.content != null)
                message.content = String(object.content);
            return message;
        };

        /**
         * Creates a plain object from a SendChat message. Also converts values to other types if specified.
         * @function toObject
         * @memberof Messages.SendChat
         * @static
         * @param {Messages.SendChat} message SendChat
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        SendChat.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults)
                object.content = "";
            if (message.content != null && message.hasOwnProperty("content"))
                object.content = message.content;
            return object;
        };

        /**
         * Converts this SendChat to JSON.
         * @function toJSON
         * @memberof Messages.SendChat
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        SendChat.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return SendChat;
    })();

    Messages.ReceiveChat = (function() {

        /**
         * Properties of a ReceiveChat.
         * @memberof Messages
         * @interface IReceiveChat
         * @property {number} code ReceiveChat code
         * @property {string} nickName ReceiveChat nickName
         * @property {string} content ReceiveChat content
         */

        /**
         * Constructs a new ReceiveChat.
         * @memberof Messages
         * @classdesc Represents a ReceiveChat.
         * @implements IReceiveChat
         * @constructor
         * @param {Messages.IReceiveChat=} [properties] Properties to set
         */
        function ReceiveChat(properties) {
            if (properties)
                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
                    if (properties[keys[i]] != null)
                        this[keys[i]] = properties[keys[i]];
        }

        /**
         * ReceiveChat code.
         * @member {number} code
         * @memberof Messages.ReceiveChat
         * @instance
         */
        ReceiveChat.prototype.code = 0;

        /**
         * ReceiveChat nickName.
         * @member {string} nickName
         * @memberof Messages.ReceiveChat
         * @instance
         */
        ReceiveChat.prototype.nickName = "";

        /**
         * ReceiveChat content.
         * @member {string} content
         * @memberof Messages.ReceiveChat
         * @instance
         */
        ReceiveChat.prototype.content = "";

        /**
         * Creates a new ReceiveChat instance using the specified properties.
         * @function create
         * @memberof Messages.ReceiveChat
         * @static
         * @param {Messages.IReceiveChat=} [properties] Properties to set
         * @returns {Messages.ReceiveChat} ReceiveChat instance
         */
        ReceiveChat.create = function create(properties) {
            return new ReceiveChat(properties);
        };

        /**
         * Encodes the specified ReceiveChat message. Does not implicitly {@link Messages.ReceiveChat.verify|verify} messages.
         * @function encode
         * @memberof Messages.ReceiveChat
         * @static
         * @param {Messages.IReceiveChat} message ReceiveChat message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReceiveChat.encode = function encode(message, writer) {
            if (!writer)
                writer = $Writer.create();
            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code);
            writer.uint32(/* id 2, wireType 2 =*/18).string(message.nickName);
            writer.uint32(/* id 3, wireType 2 =*/26).string(message.content);
            return writer;
        };

        /**
         * Encodes the specified ReceiveChat message, length delimited. Does not implicitly {@link Messages.ReceiveChat.verify|verify} messages.
         * @function encodeDelimited
         * @memberof Messages.ReceiveChat
         * @static
         * @param {Messages.IReceiveChat} message ReceiveChat message or plain object to encode
         * @param {$protobuf.Writer} [writer] Writer to encode to
         * @returns {$protobuf.Writer} Writer
         */
        ReceiveChat.encodeDelimited = function encodeDelimited(message, writer) {
            return this.encode(message, writer).ldelim();
        };

        /**
         * Decodes a ReceiveChat message from the specified reader or buffer.
         * @function decode
         * @memberof Messages.ReceiveChat
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @param {number} [length] Message length if known beforehand
         * @returns {Messages.ReceiveChat} ReceiveChat
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReceiveChat.decode = function decode(reader, length) {
            if (!(reader instanceof $Reader))
                reader = $Reader.create(reader);
            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Messages.ReceiveChat();
            while (reader.pos < end) {
                var tag = reader.uint32();
                switch (tag >>> 3) {
                case 1:
                    message.code = reader.int32();
                    break;
                case 2:
                    message.nickName = reader.string();
                    break;
                case 3:
                    message.content = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
                }
            }
            if (!message.hasOwnProperty("code"))
                throw $util.ProtocolError("missing required 'code'", { instance: message });
            if (!message.hasOwnProperty("nickName"))
                throw $util.ProtocolError("missing required 'nickName'", { instance: message });
            if (!message.hasOwnProperty("content"))
                throw $util.ProtocolError("missing required 'content'", { instance: message });
            return message;
        };

        /**
         * Decodes a ReceiveChat message from the specified reader or buffer, length delimited.
         * @function decodeDelimited
         * @memberof Messages.ReceiveChat
         * @static
         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
         * @returns {Messages.ReceiveChat} ReceiveChat
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        ReceiveChat.decodeDelimited = function decodeDelimited(reader) {
            if (!(reader instanceof $Reader))
                reader = new $Reader(reader);
            return this.decode(reader, reader.uint32());
        };

        /**
         * Verifies a ReceiveChat message.
         * @function verify
         * @memberof Messages.ReceiveChat
         * @static
         * @param {Object.<string,*>} message Plain object to verify
         * @returns {string|null} `null` if valid, otherwise the reason why it is not
         */
        ReceiveChat.verify = function verify(message) {
            if (typeof message !== "object" || message === null)
                return "object expected";
            if (!$util.isInteger(message.code))
                return "code: integer expected";
            if (!$util.isString(message.nickName))
                return "nickName: string expected";
            if (!$util.isString(message.content))
                return "content: string expected";
            return null;
        };

        /**
         * Creates a ReceiveChat message from a plain object. Also converts values to their respective internal types.
         * @function fromObject
         * @memberof Messages.ReceiveChat
         * @static
         * @param {Object.<string,*>} object Plain object
         * @returns {Messages.ReceiveChat} ReceiveChat
         */
        ReceiveChat.fromObject = function fromObject(object) {
            if (object instanceof $root.Messages.ReceiveChat)
                return object;
            var message = new $root.Messages.ReceiveChat();
            if (object.code != null)
                message.code = object.code | 0;
            if (object.nickName != null)
                message.nickName = String(object.nickName);
            if (object.content != null)
                message.content = String(object.content);
            return message;
        };

        /**
         * Creates a plain object from a ReceiveChat message. Also converts values to other types if specified.
         * @function toObject
         * @memberof Messages.ReceiveChat
         * @static
         * @param {Messages.ReceiveChat} message ReceiveChat
         * @param {$protobuf.IConversionOptions} [options] Conversion options
         * @returns {Object.<string,*>} Plain object
         */
        ReceiveChat.toObject = function toObject(message, options) {
            if (!options)
                options = {};
            var object = {};
            if (options.defaults) {
                object.code = 0;
                object.nickName = "";
                object.content = "";
            }
            if (message.code != null && message.hasOwnProperty("code"))
                object.code = message.code;
            if (message.nickName != null && message.hasOwnProperty("nickName"))
                object.nickName = message.nickName;
            if (message.content != null && message.hasOwnProperty("content"))
                object.content = message.content;
            return object;
        };

        /**
         * Converts this ReceiveChat to JSON.
         * @function toJSON
         * @memberof Messages.ReceiveChat
         * @instance
         * @returns {Object.<string,*>} JSON object
         */
        ReceiveChat.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
        };

        return ReceiveChat;
    })();

    return Messages;
})();

module.exports = $root;
